
package LwJGL;
import static org.lwjgl.opengl.GL11.*;
/**
 * Quad.java
 * Created on May 3, 2014
 * Author Joe Porter
 */
public class Quad {
    
    float x ,y;
    float size;
    float rotation;
    float r = .1f,
          g = .1f,
          b = 1f;
  public Quad(float x, float y, float size, float rotation){
      this.x = x;
      this.y = y;
      this.size = size;
      this.rotation = rotation;
  }
   private void renderGl(){
       glColor3f(r, r, b);
       glPushMatrix();
            glTranslatef(x, y, 0);
            glRotatef(rotation, 0f, 0f, 1f);
            glTranslatef(-x, -y, 0);
            
            glBegin(GL_QUADS);
                glVertex2f(x-size, y-size);
                glVertex2f(x+size, y-size);
                glVertex2f(x+size, y+size);
                glVertex2f(x-size, y+size);
            glEnd();
       glPopMatrix();
   }
   
   public void update(){
       renderGl();
   }
}
